//
//  ItemTopCollReusableView.m
//  礼物go
//
//  Created by dllo on 16/5/27.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "ItemTopCollReusableView.h"

@implementation ItemTopCollReusableView

-(instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self createSubviews];
       //self.dk_backgroundColorPicker = DKColorPickerWithRGB(0xFFFAFA,0xBEBEBE);
    }
    return self;
}

-(void)createSubviews{
   self.leftLineView = [UIView new];
    self.leftLineView.backgroundColor = [UIColor lightGrayColor];
    [self addSubview:self.leftLineView];
   
    self.nameLabel = [UILabel new];
    self.nameLabel.font = [UIFont systemFontOfSize:13];
    self.nameLabel.textAlignment = NSTextAlignmentCenter;
    [self addSubview:self.nameLabel];
    
    self.rightLineView = [UIView new];
    self.rightLineView.backgroundColor = [UIColor lightGrayColor];
    [self addSubview:self.rightLineView];
    
}

-(void)layoutSubviews{
    [super layoutSubviews];
    self.leftLineView.frame = CGRectMake(20, 15, self.frame.size.width / 3, 0.8);
    self.nameLabel.frame = CGRectMake(self.leftLineView.frame.origin.x + self.leftLineView.frame.size.width + 5, 7.5, 60, 15);
    self.rightLineView.frame = CGRectMake(self.nameLabel.frame.origin.x + self.nameLabel.frame.size.width + 5, 15, self.frame.size.width / 3, 0.8);
   self.rightLineView.backgroundColor = [UIColor lightGrayColor];
    self.leftLineView.backgroundColor = [UIColor lightGrayColor];
    self.nameLabel.textColor = [UIColor lightGrayColor];
}

-(void)setItemModel:(ItemCategoryModel *)itemModel{
    _itemModel = itemModel;
    self.nameLabel.text = _itemModel.name;
}




@end
